package org.donald.g1.task;

import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicLong;

import org.donald.g1.entity.Person;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author donald
 * 2018年3月15日
 * 上午9:22:42
 */
public class TestRunnable implements Runnable {
	private static final Logger log = LoggerFactory.getLogger(TestRunnable.class);
	private static ConcurrentLinkedQueue<Person> personQueue = new ConcurrentLinkedQueue<Person>();
	private static AtomicLong id = new AtomicLong(0);;
	@Override
	public void run() {
		
		while(true){
			long personId = id.incrementAndGet();
			personQueue.offer(new Person("donald"+personId,personId,personId+"shaoqinghan@email.com"));
			log.info("正在添加用户:{}",personId);
		}
	}

}
